]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Wanda: so long GNOME 2, and thanks for all the fish.
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 9 Mar 2013 23:26:02 +0000 (00:26 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 10 Mar 2013 14:54:40 +0000 (15:54 +0100)
gnome-panel is going away in 3.8, so we can't rely on it to provide our
friendly and reliable companion. But no regret, because we can ship it
ourselves, and at the same time remove some unnecessary configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=695526

data/Makefile.am
data/wanda.png [new file with mode: 0644]
js/ui/wanda.js

index ef3b3b48b75a1f67340c8ed1c4c0f1a6c030ff79..f555d9a84aaff1b29aac87cdd0fef1fa393dd1bf 100644 (file)
@@ -1,3 +1,6 @@
+wandadir = $(pkgdatadir)
+dist_wanda_DATA = wanda.png
+
 desktopdir=$(datadir)/applications
 desktop_DATA = gnome-shell.desktop gnome-shell-extension-prefs.desktop
 
diff --git a/data/wanda.png b/data/wanda.png
new file mode 100644 (file)
index 0000000..d56a4d4
Binary files /dev/null and b/data/wanda.png differ
index 98b964c40bc11c879c5c88d23f3401facbd329e0..3d5d568988af7a44f503cbc0ba76951e423c06be 100644 (file)
@@ -11,12 +11,14 @@ const Layout = imports.ui.layout;
 const Main = imports.ui.main;
 const Panel = imports.ui.panel;
 
-// we could make these gsettings
 const FISH_NAME = 'wanda';
+const FISH_FILENAME = 'wanda.png';
 const FISH_SPEED = 300;
 const FISH_COMMAND = 'fortune';
+// The size of an individual frame in the animation
+const FISH_HEIGHT = 22;
+const FISH_WIDTH = 36;
 
-const GNOME_PANEL_PIXMAPDIR = '../gnome-panel/fish';
 const FISH_GROUP = 'Fish Animation';
 
 const MAGIC_FISH_KEY = 'free the fish';
@@ -26,33 +28,16 @@ const WandaIcon = new Lang.Class({
     Extends: IconGrid.BaseIcon,
 
     _init : function(fish, label, params) {
-        this._fish = fish;
-        let file = GLib.build_filenamev([global.datadir, GNOME_PANEL_PIXMAPDIR, fish + '.fish']);
-
-        if (GLib.file_test(file, GLib.FileTest.EXISTS)) {
-            this._keyfile = new GLib.KeyFile();
-            this._keyfile.load_from_file(file, GLib.KeyFileFlags.NONE);
-
-            this._imageFile = GLib.build_filenamev([global.datadir, GNOME_PANEL_PIXMAPDIR,
-                                                    this._keyfile.get_string(FISH_GROUP, 'image')]);
-
-            let tmpPixbuf = GdkPixbuf.Pixbuf.new_from_file(this._imageFile);
+        this.parent(label, params);
 
-            this._imgHeight = tmpPixbuf.height;
-            this._imgWidth = tmpPixbuf.width / this._keyfile.get_integer(FISH_GROUP, 'frames');
-        } else {
-            this._imageFile = null;
-        }
+        this._fish = fish;
+        this._imageFile = GLib.build_filenamev([global.datadir, fish + '.png']);
 
-        this.parent(label, params);
+        this._imgHeight = FISH_HEIGHT;
+        this._imgWidth = FISH_WIDTH;
     },
 
     createIcon: function(iconSize) {
-        if (!this._imageFile) {
-            return new St.Icon({ icon_name: 'face-smile',
-                                 icon_size: iconSize });
-        }
-
         this._animations = new Panel.Animation(this._imageFile, this._imgWidth, this._imgHeight, FISH_SPEED);
         this._animations.play();
         return this._animations.actor;